import React, { useRef } from 'react';

const Component = React.forwardRef((props, ref: any) => {
  console.log('forwarded ref', ref);
  ref.current = 213;
  return (
    <h2>component</h2>
  );
});

export default function WhatIsRef() {
  const ref = useRef();
  console.log(ref);
  // output: { current: undefined }
  return (
    <div>
      <input ref={console.log} defaultValue="hello refs" />
      <Component ref={console.log} />
    </div>
  );
}
